<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" />
<link href="css/adminstyle.css" rel="stylesheet" type="text/css">
<link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<title>管理区域</title>
</head>
<body>
<div id="man_zone">
<div style="background-color:#FFFFFF ">
  <form  method="post" action="<?
  $id = isset($_GET['id'])?$_GET['id']:'';
   if  (empty($id)){ echo  'courseType_subAdd.html'; }else{ echo  'courseType_subUpdate.html'; }  ?>" >
    <input name="id" type="hidden" value="<?=$id?>">
  <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
      <td class="left_title_2adminssd">英文标题</td>
      <td  bgcolor="#FFFFFF"><input name="english_title" type="text"  value="<?=getStr($extract_vars,'english_title')?>"></td>
      </tr>
      <tr>
          <td class="left_title_2adminssd">大分类</td>
          <td  bgcolor="#FFFFFF">
          <select name="type">
            <option>未选择</option>
	      	<?=page_modifier_options($type1,getStr($extract_vars, 'type'))?>
          </select>
          </td>
      </tr>      
      <tr>
          <td class="left_title_2adminssd">小分类</td>
          <td  bgcolor="#FFFFFF">
          <select name="course_type">
            <option>未选择</option>
			<?=page_modifier_options($course_type1,getStr($extract_vars,'course_type'))?>
          </select>
          </td>
      </tr>
         <tr>
          <td class="left_title_2adminssd">状态</td>
          <td  bgcolor="#FFFFFF">
          <select name="status">
            <option>未选择</option>
	      	<?=page_modifier_options($status1,getStr($extract_vars, 'status'))?>
          </select>
          </td>
      </tr>
       <tr>
          <td class="left_title_2adminssd">简介</td>
          <td  bgcolor="#FFFFFF"><textarea name="smalltext" rows="10" cols="50"><?=getStr($extract_vars,'smalltext')?></textarea></td>
      </tr>
         <tr>
          <td class="left_title_2adminssd">图片(规格提醒:330*200)</td>
 	 	 <td colspan="3" bgcolor="#FFFFFF">
         
	      <?php $display_style='none'; $upload_value="";?>
	      <? if(getStr($extract_vars,'pic')!=""){?>
		  		<?  $display_style='inline-block';?>
		  		<?  $upload_value=htmlspecialchars(getStr($extract_vars,'pic'));?>
	      <? }?>
          
	      <input id="file_upload_pic" name="file_upload_pic" class="file_upload" type="file" multiple="true">
	      <br>
	      <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件</a>
	      <a class="file_link" href="../<?=$upload_value?>" target="_blank" style="display:<?=$display_style?>"/>查看</a>
	      <input type="hidden" class="file_src" name="pic" value="<?=$upload_value?>" id="pic" >	
                          
     	 </td>
      </tr>
        <tr>
          <td class="left_title_2adminssd">内容</td>
          <td  bgcolor="#FFFFFF"><?=$ueditor?>
          
		  <?=$content?></td>
      </tr>
          <tr>
          <td colspan="2" align="center"   bgcolor="#FFFFFF">&nbsp;
			</td>
			</tr>
    <tr>
      <td colspan="2" align="center"   bgcolor="#FFFFFF">
        <input name="input" type="button" class="PublicBot" value="返回" onclick="window.history.go(-1);" />
        <input name=""  class="PublicBot" type="submit" value="提交" />      </td>
    </tr>
  </table>
</form>
</div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
		$(function() {
			$('.file_upload').uploadify({
		        'uploader'  : 'js/uploadify/uploadify.swf',
		        'script'    : 'js/uploadify/uploadify.php',
		        'cancelImg' : 'js/uploadify/cancel.png',
		        'folder'    : '3',
		        'auto'      : true,
		        'fileExt'   : '*.png;*.gif;*.jpg;',
		        'fileDesc'  : 'Web Image Files (*.PNG,*.GIF,*.JPG)',
		        'sizeLimit' : '2097152',
		        'onComplete'  : function(event, ID, fileObj, response, data) {
		          $("#" + $(event.target).attr("id")).nextAll(".del_file").show();
		          $("#" + $(event.target).attr("id")).nextAll(".file_src").val(response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").attr("href","../"+response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").show();
		        }		        
			});
		});
    });	
    
    $(".del_file").click(
        function()
        {
          if(confirm("您确认要删除该附件么？"))
          {
            $(this).hide();
            $(this).nextAll(".file_src").val("");
            $(this).nextAll(".file_link").attr("href","");
            $(this).nextAll(".file_link").hide();
            alert("附件已成功删除");
          }
        }
    )
</script>
</body>
</html>
